package pers.liyan.shi.sytest;

/**
 * 劭俣航
 * @author shily
 * @date 2019/6/21 16:13
 */
public class Animal {

    private String name;

    public Animal(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                '}';
    }

    public void eatApple(Food food){
         synchronized (Animal.class){
            food.coutDown();
        }
    }
}
